<template>
  <div>
    <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o">
      表单组件测试
    </van-notice-bar>
    <Keyinbody :form-config="formConfig" :edit-source="editSource"/>
  </div>
</template>

<script>
import testData from '@/api/test.js'

export default {
  components: {
    Keyinbody: require('@/components/form/Keyinbody/index.vue')
  },
  data () {
    return {
      formConfig: {
        inputAlign: '',
        labelAlign: '',
        labelWidth: '90px',
        colon: false
      },
      value: '',
      text: '',
      tel: '',
      digit: '',
      number: '',
      password: '',
      username: '',
      editSource: testData.editData,
      editData: testData.editData
      // groups: []
    }
  },
  computed: {
    groups () {
      const arr = testData.editData.groups
      // debugger
      console.log('arr', arr)
      return arr
    }
  },
  created () {
    console.log('editSource', this.editSource)
    // // debugger
    // this.groups = testData.editData.groups || []
    // testData.editData.groups.forEach((item, index) => {
    //   debugger
    //   this.$set(this.groups, index, item)
    // })
    console.log('this.groups', this.groups)
  }
}
</script>
